package core

import "nprobe/structs"

func NewPPRBuf(spanMs int64, timeoutMs int64) *structs.PPRingBuffer[*SpanRecord] {
	psize := uint64((timeoutMs+spanMs-1)/spanMs + 2)
	RBufCap := uint64(16)
	if RBufCap <= psize {
		RBufCap = psize + 1
	}

	return structs.NewPPRingBuffer[*SpanRecord](RBufCap, psize)
}
